package cn.iocoder.yudao.module.forward.dal.mysql.eew;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.forward.dal.dataobject.eew.EewDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.forward.controller.admin.eew.vo.*;

/**
 * 预警信息 Mapper
 *
 * @author dfs
 */
@Mapper
public interface EewMapper extends BaseMapperX<EewDO> {

    default PageResult<EewDO> selectPage(EewPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EewDO>()
                .eqIfPresent(EewDO::getMsgId, reqVO.getMsgId())
                .betweenIfPresent(EewDO::getOriTime, reqVO.getOriTime())
                .likeIfPresent(EewDO::getLocName, reqVO.getLocName())
                .eqIfPresent(EewDO::getMagnitude, reqVO.getMagnitude())
                .eqIfPresent(EewDO::getForwardStatus, reqVO.getForwardStatus())
                .betweenIfPresent(EewDO::getForwardTime, reqVO.getForwardTime())
                .eqIfPresent(EewDO::getSourceId, reqVO.getSourceId())
                .eqIfPresent(EewDO::getBrokerId, reqVO.getBrokerId())
                .betweenIfPresent(EewDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EewDO::getId));
    }

}